package com.orphan.audit.dao;

import com.orphan.audit.po.GoodsInfo;
import com.orphan.audit.po.SupplierCheck;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.FetchType;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author wdn
 * @since 2021-07-16
 */

@Mapper
public interface SupplierCheckMapper extends BaseMapper<SupplierCheck> {


    @Select("select * from t_supplier_check")
    List<SupplierCheck> findAll();



//    @Results(id = "supplierCheckMap",value = {
//            @Result(column = "t_id",property = "tId",id = true),
//            @Result(column = "t_num",property = "tNum"),
//            @Result(column = "t_total",property = "tTotal"),
//            @Result(column = "t_time",property = "tTime"),
//            @Result(column = "t_stuff",property = "tStuff"),
//            @Result(column = "t_id",property = "supplierInfoList",
//                    many = @Many(select = "com.orphan.audit.dao.GoodsInfoMapper.getGoodsById",
//                            fetchType = FetchType.LAZY))//开启懒加载
//    })
//    @Select("select * from t_supplier_check")
//    List<SupplierCheck> getAll();

    @Results(id = "supplierCheckMap",value = {
            @Result(column = "t_id",property = "tId",id = true),
            @Result(column = "t_num",property = "tNum"),
            @Result(column = "t_total",property = "tTotal"),
            @Result(column = "t_time",property = "tTime"),
            @Result(column = "t_stuff",property = "tStuff"),
    })
    @Select("select * from t_supplier_check where t_id=#{tId}")
    SupplierCheck getById(@Param("tId")Integer tId);



}
